package winter_vacation_homework.day_11;

/**
 * 【LeetCode题号: 9. 回文数】
 * https://leetcode-cn.com/problems/palindrome-number/
 */
public class Palindrome {
    public boolean isPalindrome(int x) {
        if (x < 0){
            return false;
        }else {
            String str = Integer.toString(x);
            StringBuffer stringBuffer = new StringBuffer(str);
            if (stringBuffer.reverse().toString().equals(str)){
                return true;
            }else {
                return false;
            }
        }
    }
}
